$OpenBSD: patch-qtdeclarative_src_qml_jsruntime_qv4engine_cpp,v 1.2 2015/04/19 13:18:28 zhuk Exp $
Add support for OpenBSD.
--- qtdeclarative/src/qml/jsruntime/qv4engine.cpp.ports.orig	Tue Feb 17 07:57:27 2015
+++ qtdeclarative/src/qml/jsruntime/qv4engine.cpp	Wed Apr  8 00:38:31 2015
@@ -74,6 +74,9 @@
 #if USE(PTHREADS)
 #  include <pthread.h>
 #  include <sys/resource.h>
+#if OS(OPENBSD)
+#  include <sys/signal.h>
+#endif
 #if HAVE(PTHREAD_NP_H)
 #  include <pthread_np.h>
 #endif
@@ -108,6 +111,12 @@ quintptr getStackLimit()
     } else
         size = pthread_get_stacksize_np(thread_self);
     stackLimit -= size;
+#  elif OS(OPENBSD)
+    stack_t sinfo;
+    pthread_t thread_self = pthread_self();
+    pthread_stackseg_np(thread_self, &sinfo);
+    stackLimit = reinterpret_cast<quintptr>(sinfo.ss_sp);
+    stackLimit -= sinfo.ss_size;
 #  else
     void* stackBottom = 0;
     pthread_attr_t attr;
